package site.fantasycube.blog.config.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 幻&乐
 * @Date 2021/12/26
 * 描述 用户控制层
 */
@Configuration
public class InterceptorConfiger implements WebMvcConfigurer {

    private SecuretyIntertor securetyIntertor;

    @Autowired
    public void setSecuretyIntertor(SecuretyIntertor securetyIntertor) {
        this.securetyIntertor = securetyIntertor;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(securetyIntertor)
                .addPathPatterns("/**");
    }
}
